package main

import (
	"fmt"
	"gitee.com/sqxwww/sqltemplate"
)

func main() {
	tpl := sqltemplate.New(sql)
	fmt.Println(tpl.Parse(map[string]interface{}{
		"col2": "const",
		"id":   231,
		"size": []int{1, 3, 5},
	})) // result select col1, 'const' as col2 from table where id = ? and size in (?,?,?) [231 1 3 5]
}

var sql = `select col1, '{{param .col2}}' as col2 from table where id = {{prepare .id}} and size in ({{prepare .size}})`
